package com.tanhua.server.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tanhua.server.mapper.AnnouncementMapper;
import com.tanhua.server.pojo.Announcement;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @description:
 * @author: Administrator
 * @date: Created in 2021/2/24 21:08
 * @version: 0.0.1
 * @modified By:
 */
@Service
public class AnnouncementService {

    @Autowired
    private AnnouncementMapper announcementMapper;

    public IPage<Announcement>queryList(Integer page,Integer pageSize){
        QueryWrapper queryWrapper=new QueryWrapper<>();
        queryWrapper.orderByDesc("created");
      return   this.announcementMapper.selectPage(new Page<Announcement>(page,pageSize),queryWrapper);
    }
}
